let initState = 0;

function Reducer(preState = initState, action) {
    const { type, data } = action;
    let result = 0;
    switch (type) {
        case 'increment':
            result = preState + data*1;
            break;
        case 'decrement':
            result = preState - data*1;
            break;
        default:
            result = preState;
            break;
    }
    console.log(result)
    return result
}

export default Reducer